package com.telit.dispose.enums;

/**
 * Create by Chencf 2022/09/15
 */
public enum ResourceEnums {

    DOWN("无人机", "comm_uav"),
    UP("视频监控", "fire_camera");


    private String code;
    private String str;

    ResourceEnums(String code, String str) {
        this.code = code;
        this.str = str;
    }

    public String getCode() {
        return code;
    }

    public String getStr() {
        return str;
    }

    /**
     * 根据code  获取对应的str描述字符串
     */
    public static String code2Str(String code) {
        if (code == null) {
            return null;
        }
        for (ResourceEnums statusNum : ResourceEnums.values()) {
            if (statusNum.getCode().equals(code)) {
                return statusNum.getStr();
            }
        }
        return null;
    }

}
